--- title: Atmospheric Correction keywords: fastai sidebar: home_sidebar summary: "Out in the field, the OpenHSI camera measures light as it is reflected off surfaces. This light from the sun has absorption features from molecules/aerosols in the atmosphere and scattering. After converting the raw digital number counts into radiance" description: "Out in the field, the OpenHSI camera measures light as it is reflected off surfaces. This light from the sun has absorption features from molecules/aerosols in the atmosphere and scattering. After converting the raw digital number counts into radiance" nb_path: "03_atmos.ipynb" ---
Find the closest station at http://weather.uwyo.edu/upperair/sounding.html
to use the atmospheric sounding on the day.
find the station number and region code (for example, south pacific is pac and new zealand is nz)
Default is Willis Island in Queensland, Australia.
https://py6s.readthedocs.io/en/latest/helpers.html#importing-atmospheric-profiles-from-radiosonde-data
solar zenith angle already taken into account
Permanently broken.
Py6S provides a method to loop over an array and return the 6SV result. However, it does not have a progress bar. For something that can take several minutes, not knowing how long it will take is genuinely frustrating. Therefore, we provide a modified version of SixSHelpers.Wavelengths.run_wavelengths called Model6SV.run_wavelengths that has a progress bar.
To use 6SV, Py6S will write input files and parse the output files. All this I/O is slow but we got to deal with it. Py6S is clever about it though and uses threading to do some compute while waiting for files. The modified version follows the same method except with the addition of a callback to update the progress bar when interations are done.
model = Model6SV(λ_array=np.arange(0.35, 1., 0.01))
model.show()
from scipy.interpolate import interp1d
rad_fit = interp1d(model.λ_array*1e3, model.radiance/10, kind='cubic')
#spec_rad_ref = np.float64(sfit(self.dcube.wavelength))
rad_fit(np.arange(400,800,10))